<template>
  <div>
    <van-index-anchor :index="item" />
    <van-cell @click="changeFn(a.label)" :title="a.label" v-for=" (a,index) in allCity " :key='index' />
  </div>
</template>

<script>
// import { getAllCity } from '@/api/atticle'
// import { computed } from 'vue'
export default {
  props: ['az', 'item', 'body'],
  data () {
    return {}
  },
  // async created () {
  //   console.log(this.item)
  //   const { body } = await getAllCity()
  //   const a = body.filter((item) => {
  //     return item.short[0].toUpperCase() === this.item
  //   })
  //   console.log(a)
  // },
  computed: {
    allCity () {
      const a = this.body.filter((item) => {
        return item.short[0].toUpperCase() === this.item
      })
      return a
    }
  },
  methods: {
    changeFn (title) {
      console.log(title)
      this.$emit('change', title)
    }
  }
}
</script>

<style></style>
